package com.jxt.app.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.jxt.app.dao.ApsharePostDAO;
import com.jxt.app.entity.ApsharePost;
import com.jxt.app.entity.ApsharePostExample;
import com.jxt.app.service.ApSharePostService;
import com.jxt.app.util.Page;

@Service
public class ApSharePostServiceImpl implements ApSharePostService{
	
	@Resource
	private ApsharePostDAO apsharePostDAO;

	@Override
	public int deleteModel(ApsharePostExample record) {
		// TODO Auto-generated method stub
		return apsharePostDAO.deleteByExample(record);
	}

	@Override
	public Page findListByExample(ApsharePostExample inparam, int page, int num)
			throws Exception {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public ApsharePost getModelById(long id) {
		// TODO Auto-generated method stub
		return apsharePostDAO.selectByPrimaryKey((long)id);
	}

	@Override
	public int insertModel(ApsharePost record) {
		// TODO Auto-generated method stub
		int	ret=0;
		try{
			apsharePostDAO.insert(record);
			ret=1;
		}catch(Exception e){
			e.printStackTrace();
		}
		
		return ret;
	}

	@Override
	public List<ApsharePost> listModel(ApsharePostExample example) {
		// TODO Auto-generated method stub
		return apsharePostDAO.selectByExampleWithBLOBs(example);
	}

	@Override
	public int updateModel(ApsharePostExample record) {
		// TODO Auto-generated method stub
		return apsharePostDAO.updateByPrimaryKeySelective(record);
	}

}
